feat: make ALLOWED_HTTP_HOSTS configurable via env var#3
Merged
jeremyeder merged 1 commit intomainfrom Mar 20, 2026
Merged
Conversation
Add support for ALLOWED_HTTP_HOSTS environment variable (comma-separated) to allow external hostnames through DNS rebinding protection. deploy.sh now auto-injects the OpenShift route hostname on apply. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting WalkthroughThe changes implement dynamic HTTP hosts allowlist configuration for OpenShift deployments. The deploy script extracts the Route hostname and sets it as an environment variable, which the mcp_server application reads at startup to extend its allowed hosts configuration for DNS rebinding protection. Changes
Sequence DiagramsequenceDiagram
participant Deploy as Deploy Script
participant OpenShift as OpenShift API
participant Kubectl as kubectl/oc
participant Deployment as Deployment
participant App as mcp_server
Deploy->>OpenShift: Query Route hostname for gps-mcp-server
OpenShift-->>Deploy: Return .spec.host
Deploy->>Kubectl: Set ALLOWED_HTTP_HOSTS env var on deployment
Kubectl->>Deployment: Update environment
Deployment->>App: Start application with env var
App->>App: Read ALLOWED_HTTP_HOSTS from environment
App->>App: Parse comma-separated values
App->>App: Append to existing allowed_hosts list
App->>App: Configure DNS rebinding protection
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
jeremyeder
added a commit
that referenced
this pull request
Mar 23, 2026
Add support for ALLOWED_HTTP_HOSTS environment variable (comma-separated) to allow external hostnames through DNS rebinding protection. deploy.sh now auto-injects the OpenShift route hostname on apply. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ALLOWED_HTTP_HOSTSenv var support inmcp_server.py(comma-separated hostnames appended to the default allow list)deploy.shauto-injects the OpenShift route hostname intoALLOWED_HTTP_HOSTSon apply/mcpvia the OpenShift routeTest plan
scripts/test.shpasses (11/11)/healthreturns{"status": "ok"}/mcpreturns successful MCP initialize response via route🤖 Generated with Claude Code